﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                province.Items.Add("重庆");
                province.Items.Add("福建");
                province.Items.Add("山东");
                city.Items.Add("重庆");
                city.Items.Add("丰都");
                city.Items.Add("涪陵");

            }
        }
        protected void province_TextChanged(object sender, EventArgs e)
        {
            string p = province.SelectedValue;
            city.Items.Clear();
            if (p == "重庆")
            {
                city.Items.Add("重庆");
                city.Items.Add("丰都");
                city.Items.Add("涪陵");
            }
            else if (p == "福建")
            {
                city.Items.Add("福州");
                city.Items.Add("泉州");
                city.Items.Add("厦门");
            }
            else if (p == "山东")
            {
                city.Items.Add("济南");
                city.Items.Add("临沂");
                city.Items.Add("淄博");
            }


        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (RadioButton1.Checked) { Label1.Text = $"用户名：{TextBox1.Text},密码：{Password1.Value},密码：{Password1.Value},性别:{RadioButton1.Text},籍贯：{province.SelectedValue}{city.SelectedValue},爱好：{TextBox2.Text},其他信息：{TextBox3.Text}"; }
            else { Label1.Text = $"用户名：{TextBox1.Text},密码：{Password1.Value},性别:{RadioButton2.Text},籍贯：{province.SelectedValue}省{city.SelectedValue},爱好：{TextBox2.Text},其他信息：{TextBox3.Text}"; }
        }

    }
}